package com.wjk.kylin.id.server.uid.controller;


import com.wjk.kylin.id.server.dto.*;
import com.wjk.kylin.id.server.uid.service.IUIdInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * uid信息表 前端控制器
 * </p>
 *
 * @author wangjinkui
 * @since 2022-09-22
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/uid")
public class UIdInfoController {

    @Autowired
    private IUIdInfoService uIdInfoService;

    /**
     * 百度uid 查询工作id
     *
     * @param inDTO
     * @return
     */
    @PostMapping("/worker/id")
    public BaseOutDTO queryWorkerId(@Validated @RequestBody QueryWorkerIdInDTO inDTO) {
        WorkerIdDTO workerIdDTO = uIdInfoService.queryWorkerId(inDTO);

        return DataOutDTO.builder().data(workerIdDTO).build();
    }

}

